package jtk.project4.fleet.field;

import java.awt.FlowLayout;
import java.util.Date;

import nl.coderight.jazz.form.FormLayout;
import jtk.project4.fleet.domain.BrowsePayments;
import jtk.project4.fleet.domain.Equipment;
import jtk.project4.fleet.domain.Invoices;
import jtk.project4.fleet.domain.Payments;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.DisplayField;
import nl.coderight.jazz.form.field.LabelField;
import nl.coderight.jazz.form.field.SpinnerField;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.TableField.AutoResizeMode;
import nl.coderight.jazz.form.field.table.TableFieldColumn;

public class BrowsePaymentsFields extends GroupControl<BrowsePayments>{

	private TableField<Invoices> bpTable;
	private TableField<Payments> bpTable2;
			
	public BrowsePaymentsFields(String bindID){
		setBindID(bindID);
		createFields();
		createLayout();
		
	}
	
	
	private void createLayout() {
		setLayout(new FormLayout ())
		//.addField(bpTable)
		.addField(bpTable2)
		;
		;
	}
	
	
	private void createFields(){
		//bpTable = new TableField<Invoices>("invoices","invoice");
		bpTable2 = new TableField<Payments>("payments","payment");
		//bpTable.setAutoResizeMode(AutoResizeMode.OFF);
		bpTable2.setAutoResizeMode(AutoResizeMode.OFF);
		
		bpTable2.addColumn("Date Received", "dateR");
		bpTable2.addColumn("Invoice#", " "/*"invNo"*/);
		bpTable2.addColumn("Location", " "/*"locId"*/);
		bpTable2.addColumn("Customer", "custId");
		bpTable2.addColumn("Amount", "amount");
		bpTable2.addColumn("Payment Method", "payMethod");
		bpTable2.addColumn("Check#", "checkNo");
		bpTable2.addColumn("Card#","cardNo");
		bpTable2.addColumn("Name on Card","cardName");
		bpTable2.addColumn("Exp Month","expMonth");
		bpTable2.addColumn("Exp Year","expYear");
		bpTable2.addColumn("Transaction#","transNo");
		bpTable2.addColumn("Other Payment Method","other");
	
	}
	
	private GroupControl createTableFieldColumn() {
		GroupControl tableFieldColumn = new GroupControl();
		tableFieldColumn.setLayout(new FlowLayout(FlowLayout.LEFT));
		//tableFieldColumn.focusField(bpTable);
		tableFieldColumn.focusField(bpTable2);
		return tableFieldColumn;
	}
}
